package jupp;

import java.util.Scanner;

public class HelloJupp
{
	public static void main(String[] args) throws Exception
	{
		JuppMap<String> jm = new JuppMap<String>("hello.jupp");
		String name = jm.get("name");
		if (name != null)
		{
			System.out.println("Hello, " + name + "!");
			System.out.println("If you're not '" + name + "', enter your name now (or X to delete):");
		}
		else
			System.out.println("Sorry, I don't know who you are. What's your name?");
		Scanner scanner = new Scanner(System.in);
		name = scanner.nextLine();
		if ("X".equals(name))
		{
			jm.remove("name");
			System.out.println("OK, I won't know you next time. Bye.");
		}
		else
		{
			jm.put("name", name);
			System.out.println("OK, I'll greet you as '" + name + "' next time. Bye.");
		}
	}
}
